<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="jquery-3.1.1.min.js"></script>
    <script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
    <style>
        input.ng-invalid{
            background-color: red;
        }

    </style>
</head>
<body>

<div id='div1' ng-app="" >
    <p>名字 : <input type="text" ng-model="name"></p>
    <h1>Hello {{name}}</h1>
</div>



<div id='div2' ng-app="c" ng-controller="cc">
    名字: <input ng-model="name">
</div>

<form id= "form" ng-app="d" ng-controller="dd">
    输入你的名字:
    <input ng-model="myText" required>
</form>


<div id="httpget" ng-app="get" ng-controller="myctrl">
    <p>{{data}}</p>
</div>
<script>

//    angular.module('a',[]).controller('aa',function ($scope) {
//        $scope.getName = function () {
//            return $scope.name;
//        }
//    });

    angular.module('c',[]).controller('cc',function ($scope) {
        $scope.name = "haha";
    })

    angular.module('d',[]).controller('dd',function ($scope) {
        $scope.myText = "nnnn";
    })

    angular.module('get',[]).controller('myctrl',function ($scope,$http) {
        $http.get("http://online.izhikang.com:9011/api/wechat/1/campaigns?grade=&form_type=&page=1&per_page=10").then(function (res) {
           $scope.data = res.data.data.campaigns[0].campaign_form.subtitle;
        });
    })

    angular.element(document).ready(function () {
//        angular.bootstrap(document.getElementById('div1'),['a']);
        angular.bootstrap(document.getElementById('div2'),['c']);
        angular.bootstrap(document.getElementById('form'),['d']);
        angular.bootstrap(document.getElementById('httpget'),['get']);
    });


</script>


</body>
</html>